<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['middleware' => ['cors']], function() {

    Route::get('express/list', 'ExpressController@list'); // 物流列表
    Route::any('order/notify', 'OrderController@notify');//订单支付回调
    Route::middleware('auth.api')->group(function () {

        Route::post('order/submit-preview', 'OrderController@confirmOrder');    // 确认订单
        Route::post('order/submit', 'OrderController@submitOrder');//提交订单
        
        Route::get('order/list', 'OrderController@list');//订单列表
        Route::post('order/revoke', 'OrderController@revoke');//订单取消
        Route::post('order/confirm', 'OrderController@confirm');//订单确认收货
        Route::get('order/detail', 'OrderController@detail');//订单详情
        Route::get('order/express-detail', 'OrderController@expressDetail');//物流详情

        Route::get('order/share-order', 'OrderController@shareOrder');//分销订单

        Route::get('order/pay-data', 'OrderController@payData');//订单支付数据

        Route::get('order/comment-preview', 'CommentController@commentPreview');// 订单评论浏览页面
        Route::post('order/comment', 'CommentController@comment');// 订单评论

        Route::get('order/refund-preview', 'RefundController@refundPreview');// 订单售后浏览页面
        Route::post('order/refund', 'RefundController@refund');      // 售后订单提交
        Route::get('order/refund-detail', 'RefundController@refundDetail');      // 售后订单详情
        Route::post('order/refund-send', 'RefundController@refundSend');      // 售后订单发货
    });
       
});